﻿package states {
	import org.flixel.*;

	/**
	 * ...
	 * @author test
	 */
	public class LossState extends FlxState {


		public function LossState(){
			var title:FlxText = new FlxText(FlxG.width / 2, FlxG.height / 3, FlxG.width, "Failed.");
			title.setFormat(null, 20, 0x000000, "center");
			this.add(title);

			var btn_sprite:FlxSprite = new FlxSprite(0, 0);
			btn_sprite.createGraphic(btn_size["x"], btn_size["y"], 0xff000000);
			var btn_txt:FlxText = new FlxText(0, 0, FlxG.width, "Return");
			btn_txt.setFormat(null, 10, 0xffffff, "center");
			
			var return_btn:FlxButton = new FlxButton(FlxG.width / 2, FlxG.height / 2 + 50, returnClick);
			return_btn.loadGraphic(btn_sprite);
			return_btn.loadText(btn_txt)
			this.add(return_btn);
		}

		public function returnClick():void {
			FlxG.state = new MenuState;
		}
	}

}